package com.ruoyi.basedata.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.math.BigDecimal;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 换记录对象 t_replace
 *
 * @author gdqt
 * @date 2024-03-12
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName("t_replace")
public class Replace extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 自增主键
     */
    @TableId
    private Integer id;

    /**
     * 设备归属水司
     */
    @TableField("tenant_id")
    private String tenantId;

    /**
     * 区域编号
     */
    @TableField("sheets_code")
    private String sheetsCode;

    @TableField("sheets_id")
    private Integer sheetsId;

    @Excel(name = "所属区域")
    @TableField(exist = false)
    private String sheetsName;

    /**
     * 型号分类(1:大表,2:小表)
     */
    @Excel(name = "表类型", dictType = "terminal_meter_type")
    @TableField("terminal_classify")
    private Integer terminalClassify;

    /**
     * 旧表编号
     */
    @Excel(name = "旧表编号")
    @TableField("old_terminal_id")
    private String oldTerminalId;

    /**
     * 旧表厂家
     */
    @Excel(name = "旧表厂家", dictType = "terminal_supplier")
    @TableField("old_supplier_id")
    private String oldSupplierId;

    /**
     * 旧表最后结算读数
     */
    @Excel(name = "旧表最后结算读数")
    @TableField("old_settlement_reading")
    private BigDecimal oldSettlementReading;

    /**
     * 新表编号
     */
    @Excel(name = "新表编号")
    @TableField("new_terminal_id")
    private String newTerminalId;

    /**
     * 新表厂家
     */
    @Excel(name = "新表厂家", dictType = "terminal_supplier")
    @TableField("new_supplier_id")
    private String newSupplierId;

    /**
     * 新表表底数
     */
    @Excel(name = "新表表底数")
    @TableField("new_base_reading")
    private BigDecimal newBaseReading;

    /**
     * 换表时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "换表时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @TableField("change_time")
    private Date changeTime;

    /**
     * 操作人员
     */
    @Excel(name = "操作人员")
    @TableField("operator")
    private String operator;

    /**
     * 备注
     */
    @Excel(name = "备注")
    @TableField("remark")
    private String remark;

    @TableField(exist = false)
    private Integer loginUserId;

    @TableField(exist = false)
    private Integer systemFlag;

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("tenantId", getTenantId())
                .append("sheetsCode", getSheetsCode())
                .append("terminalClassify", getTerminalClassify())
                .append("oldTerminalId", getOldTerminalId())
                .append("oldSupplierId", getOldSupplierId())
                .append("newTerminalId", getNewTerminalId())
                .append("newSupplierId", getNewSupplierId())
                .append("changeTime", getChangeTime())
                .append("oldSettlementReading", getOldSettlementReading())
                .append("newBaseReading", getNewBaseReading())
                .append("operator", getOperator())
                .append("remark", getRemark())
                .toString();
    }
}
